import 'package:flutter/material.dart';
import 'package:hospitable_rental/routes/routes.dart';

class PageContent extends StatelessWidget {
  final String? name;

  const PageContent({Key? key, this.name}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("当前页面：" + name.toString()),
      ),
      body: Center(
        child: Column(
          children: [
            ElevatedButton(
              onPressed: () => Navigator.of(context).pushNamed(Routes.home),
              child: Text("首页"),
            ),
            ElevatedButton(
              onPressed: () => Navigator.of(context).pushNamed(Routes.login),
              child: Text("登录"),
            ),
            ElevatedButton(
              onPressed: () => Navigator.of(context).pushNamed(Routes.notFound),
              child: Text("无效页面"),
            ),
            ElevatedButton(
              onPressed: () => Navigator.of(context).pushNamed(
                Routes.roomDetail,
                arguments: RouteSettings(arguments: {
                  "roomId": ["222222"]
                }),
              ),
              child: Text("房间详情"),
            ),
          ],
        ),
      ),
    );
  }
}
